home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / BLEXTEND.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  2.5 KB  |  161 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // BlazeClass
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #ifndef MK_FP
  21. #define MK_FP(seg,ofs)  ((void _seg *)(seg) + (void near *)(ofs))
  22. #endif
  23.  
  24. #define I asm
  25.  
  26. extern void CompleteMouseReset(); // To reset mouse after video switch
  27.  
  28. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29. //
  30. // [] operator
  31. //
  32. // Change the current text mode to another one or an extended one
  33. //
  34. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  35.  
  36. BlazeClass& BlazeClass::operator[] (int ExtendedVideoMode)
  37. {
  38.   if (!ExtendedVideoMode)
  39.     goto GetInformation;
  40.   else if (ExtendedVideoMode==500) // 80x25
  41.   {
  42.     I int 11h
  43.     if ((_AX&48)==48)
  44.     {
  45.       I mov ax,7
  46.       I int 10h
  47.     }
  48.     else
  49.     {
  50.       I mov ax,3
  51.       I int 10h
  52.     }
  53.     goto GetInformation;
  54.   }
  55.   else if (ExtendedVideoMode==600) // 80x43 80x50
  56.   {
  57.     char l, t, k;
  58.  
  59.     I int 11h
  60.     if ((_AX&48)==48)
  61.     {
  62.       I mov ax,7
  63.       I int 10h
  64.     }
  65.     else
  66.     {
  67.       I mov ax,3
  68.       I int 10h
  69.     }
  70.  
  71.     I mov ah,0fh
  72.     I int 10h
  73.     I mov ax,1a00h
  74.     I int 10h
  75.     I mov l,al;
  76.     I mov t,bl;
  77.  
  78.     if (l==0x1a)
  79.     {
  80.       switch (t)
  81.       {
  82.         case 4:
  83.         case 5:
  84.           I mov word ptr k,43;
  85.           break;
  86.         case 7:
  87.         case 8:
  88.         case 11:
  89.         case 12:
  90.           I mov word ptr k,50;
  91.           break;
  92.         default:
  93.           I mov word ptr k,25;
  94.           break;
  95.       }
  96.     }
  97.     else
  98.     {
  99.       I mov ah,12h
  100.       I mov bl,10h
  101.       I int 10h
  102.  
  103.       if (_BL==0x10)
  104.         I mov word ptr k,25
  105.       else
  106.         I mov word ptr k,43
  107.     }
  108.  
  109.     if (k>25)
  110.     {
  111.       I mov ax,1112h
  112.       I xor bl,bl
  113.       I int 10h
  114.       I mov ax,1103h
  115.       I xor bl,bl
  116.       I int 10h
  117.     }
  118.  
  119.     goto GetInformation;
  120.   }
  121.  
  122.   I int 11h
  123.   if ((_AX&48)==48)
  124.   {
  125.     I mov ax,7
  126.     I int 10h
  127.   }
  128.   else
  129.   {
  130.     I mov ax,3
  131.     I int 10h
  132.   }
  133.  
  134.   I mov ax,ExtendedVideoMode
  135.   I int 10h
  136.  
  137. GetInformation:
  138.  
  139.   ScreenHeight=(*(char far *)MK_FP(0x40,0x84))+1;
  140.   ScreenHeight=(ScreenHeight==1)?25:ScreenHeight;
  141.  
  142.   _AH=0x0f;
  143.   I int 10h
  144.   ScreenWidth=_AH;
  145.  
  146.   QuickWidth=ScreenWidth*2;
  147.  
  148.   WinWide=ScreenWidth;
  149.   WinHigh=ScreenHeight;
  150.   WinX=0;
  151.   WinY=0;
  152.   X=0;
  153.   Y=0;
  154.  
  155.   if (MouseAvailable)
  156.     CompleteMouseReset();
  157.  
  158.   return *this;
  159. }
  160.  
  161.